home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / PowerPlant / AGA Classes 1.2 / Buttons / LAGAIconButton.h < prev    next >
Encoding:
Text File  |  1996-06-30  |  3.9 KB  |  108 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    LAGAIconButton.h
  3. // ===========================================================================
  4. //    “Apple Grayscale Appearance” compliant (almost) icon button
  5. //    Copyright © 1996 Chrisoft (Christophe ANDRES)  All rights reserved.
  6. //
  7. //    You may use this source code in any application (commercial, shareware, freeware,
  8. //    postcardware, etc), but not remove this notice (no need to acknowledge the use of
  9. //    this class in the about box)
  10. //    You may not sell this source code in any form. This source code may be placed on 
  11. //    publicly accessable archive sites and source code disks. It may not be placed on 
  12. //    profit archive sites and source code disks without the permission of the author, 
  13. //    Christophe ANDRES.
  14. //    
  15. //        This source code is distributed in the hope that it will be useful,
  16. //        but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. //        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. //
  19. //    If you make any change or improvement on this class, please send the improved/changed
  20. //    version to : chrisoft@calva.net or Christophe ANDRES
  21. //                                     20, rue Prosper Mérimée
  22. //                                     67100 STRASBOURG
  23. //                                     FRANCE
  24. //
  25. // ===========================================================================
  26. //    LAGAIconButton.cp            <- double-click + Command-D to see class implementation
  27. //
  28. //    LAGAIconButton is my implementation of the “Apple Grayscale Appearance for System 7.5”
  29. //        Icon Buttons with the exception of the pressed state. The pressed state is my own kind,
  30. //        because I (and my customers) found it nicer than Apple's ;-)
  31. //
  32. //        The button supports icon families or cicn (use 'ICN#' and 'cicn' in constructor. To
  33. //        get the best result, the size of the button should be 5 pixels more than the icon (so for
  34. //        a 32X32 icon, the minimum size should be 37X37)
  35. //
  36. //        if mRadioBehavior is set, the Icon Button acts as a RadioButton and can be used with
  37. //        a radio group
  38. //
  39. //        This class requires AGAColors.cp to be present in your project
  40. //
  41. //        Version : 1.2
  42. //
  43. //        Change History (most recent first, date in US form : mm/dd/yy):
  44. //
  45. //                        06/30/96    ca        Public release of version 1.2
  46. //                        06/04/96    ca        Added static RegisterClass for easier class registration
  47. //                                                        Added guard macros in header files
  48. //                                                        Increased version to 1.2
  49. //                        05/11/96    ca        Increased version to 1.1
  50. //                                                        Added copy constructor
  51. //                                                        Added "on the fly" constructor
  52. //                                                        Added change history
  53. //                        04/22/96    ca        class made available by Christophe ANDRES <chrisoft@calva.net>
  54. //                                                        (version 1.0)
  55. //
  56. //        To Do:
  57. //
  58.  
  59. #ifndef _H_LAGAIconButton
  60. #define _H_LAGAIconButton
  61. #pragma once
  62.  
  63. #include <LControl.h>
  64. #include <Icons.h>
  65.  
  66. class    LAGAIconButton : public LControl
  67. {
  68.     public        :
  69.         enum { class_ID = '3DbT' };
  70.         static void RegisterClass ();                                                                                                                                        //    <06/04/96    ca>
  71.         static LAGAIconButton* CreateAGAIconButtonStream (LStream *inStream);
  72.     
  73.         LAGAIconButton ();
  74.         
  75.         LAGAIconButton (LStream *inStream);
  76.         
  77.         LAGAIconButton (const LAGAIconButton &inOriginal);                                                                                            //    <05/11/96 ca>
  78.         
  79.         LAGAIconButton (const SPaneInfo &inPaneInfo, MessageT inClickedMessage, OSType inIconType,            //    <05/11/96 ca>
  80.                                         ResIDT inIconID, Boolean inRadioButtonBehavior);
  81.         
  82.         virtual ~LAGAIconButton ();
  83.         
  84.         virtual void SetValue (Int32 inValue);
  85.                                     
  86.     protected    :
  87.         virtual void HotSpotResult (Int16 inHotSpot);
  88.         
  89.         virtual void HotSpotAction (Int16 inHotSpot, Boolean inCurrInside, Boolean inPrevInside);
  90.  
  91.         virtual void DrawSelf ();    
  92.         
  93.         virtual void DrawGraphic (Boolean inPushed);
  94.         
  95.         virtual void DisableSelf () { Refresh(); };
  96.  
  97.         virtual void EnableSelf () { Refresh(); };
  98.         
  99.         virtual short GetIconID () { return(mIconID); };
  100.  
  101.         short mIconID;
  102.         OSType mIconType;
  103.         CIconHandle mIcon;
  104.         Boolean mRadioBehavior;
  105. };
  106.  
  107. #endif
  108.